package com.junmiao.A.postProcess;

import com.junmiao.A.stockModel.SinaJSBean;

public class SinaJSPostProcess {
	
	public static SinaJSBean postSinaJSBeanProcess(String resp){
		
		int index= resp.indexOf("\"");
		
		if(index > 10){
		    String stockNo = resp.substring(index-7,index-1);
		    String tmp = resp.substring(index +1);
		    String[] stockInfos = tmp.split(",");
		   
		    if(stockInfos!=null&&stockInfos.length>30){
		          SinaJSBean sjs = new SinaJSBean();
		          
		          sjs.setStockNo(stockNo);
		          sjs.setStockName(stockInfos[0]);
		          sjs.setToday_open(stockInfos[1]);
		          sjs.setLastday_close(stockInfos[2]);
		          sjs.setToday_close(stockInfos[3]);
		          sjs.setToday_high(stockInfos[4]);
		          sjs.setToday_low(stockInfos[5]);
		          sjs.setDate(stockInfos[30]);
		          
		          return sjs;
		          
		    }
		}  
		
		
		System.out.println("SinaJSPostProcess return null");
		return null;
			
	}
}

	
